<template>
  <div class="dialog">
    <div class="dialog-header">
      <div class="dialog-header-title">{{title}}</div>
      <div class="dialog-header-close" @click="closeE">x</div>
    </div>
    <div class="dialog-content">
      <slot></slot>
    </div>
  </div>
</template>

<script setup>
import { defineProps,defineEmits } from 'vue';
defineProps({
  title:String
})
const emits=defineEmits(['close'])
const closeE=()=>{
  console.log(2)
  emits('close')
}
</script>

<style lang="scss" scoped>
.dialog {
  width: 90%;
  // height: 80vh;
  max-width: 1080px;
  // max-height: 700px;
  background: #1a2d35;
  position: fixed;
  left: 50%;
  top: 10%;
  transform: translate(-50%, 0%);
  &-header {
    width: 100%;
    height: 40px;
    background: #27386f;
    position: relative;
    &-title {
      position: absolute;
      left: 50%;top: 0;
      transform: translate(-50%,0);
      width: 100px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      font-size: 18px;
      color: #fff;
      margin: 0 auto;
    }
    &-close{
      width: 40px;
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      color: #fff;
      position: absolute;
      right: 0;top: 0;
    }
  }
}
</style>
